package com.julian.templatePattern.javaAPI;

import java.awt.*;

/**
 * 在默认状态paint()不做事情的，因为他是一个”钩子“【意思是可选项】
 */
public class MyFrame extends Frame {

    public MyFrame(String title) throws HeadlessException {
        super(title);
        this.setSize(300,300);
        this.setVisible(true);
    }

    @Override
    public void paint(Graphics g) {
        super.paint(g);
        String msg = "i rule";
        g.drawString(msg,100,100);
    }

    public static void main(String[] args) {
        MyFrame myFrame = new MyFrame("Head First Design Pattern");
    }
}
